package org.exeed.entity;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;
@Data
@TableName(value = "tb_page", autoResultMap = true)
public class PageEntity {

    private Long id;

    private String path; // 页面路径

    private String title; // 页面标题

    private String type; // 页面类型 main/article/home/model/search/milestone

    private String articleType; // 文章类型

    private String des; // 简介

    private String thumbnailUrl ; // 缩略图地址

    private String thumbnailFileName; // 封面文件名

//    private Integer isArticle; //是否为文章，0否，1是

    private Long publishTime; // 发布时间

    @TableField(value = "page_content", typeHandler = FastjsonTypeHandler.class)
    private JSONObject pageContent; //页面内容

    private String pdfResourceUrl; // PDF资源链接

    private Long updateTime; // 更新时间

    private String brand; // 品牌


    public void copy(PageSketchEntity entity){
        this.setId(entity.getId());
        this.setPath(entity.getPath());
        this.setTitle(entity.getTitle());
        this.setDes(entity.getDes());
        this.setThumbnailUrl(entity.getThumbnailUrl());
        this.setThumbnailFileName(entity.getThumbnailFileName());
//        this.setIsArticle(entity.getIsArticle());
        this.setPublishTime(entity.getPublishTime());
        this.setPageContent(entity.getPageContent());
        this.setType(entity.getType());
        this.setArticleType(entity.getArticleType());
        this.setPdfResourceUrl(entity.getPdfResourceUrl());
        this.setBrand(entity.getBrand());
    }

}
